const axios = require('axios');

(async () => {
  try {
    const url = 'https://ark.cn-beijing.volces.com/api/v3/chat/completions';
    const apiKey = '97fef7f1-56e5-4290-978c-9072c918df67'; // 填写真实key
    const data = {
      model: 'doubao-seed-1.6-250615', // 或 deepseek-r1-250528 等
      messages: [
        {
          role: 'user',
          content: '你好？'
        }
      ],
      max_tokens: 256,
      temperature: 0.7,
      stream: false
    };
    const res = await axios.post(url, data, {
      headers: {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
      },
      timeout: 30000
    });
    console.log('【火山方舟AI响应】');
    console.log('状态码:', res.status);
    console.log('返回内容:', res.data);
  } catch (err) {
    console.error('❌ 请求失败:', err.message);
    if (err.response) {
      console.error('响应内容:', err.response.data);
    }
  }
})(); 